mod accept;
mod builder;
mod handle;
mod server;
mod service;
mod signals;
mod socket;
mod token;
mod waker_queue;
mod worker;
mod availability;

use core::task;
use std::{future::Future, task::Poll};

pub use self::{builder::ServerBuilder, server::Server};

pub trait Service<Req> {
    // 这些类型都需要外部指定
    type Response;
    // 这些类型都需要外部指定
    type Error;
    // 这些类型都需要外部指定
    type Future: Future<Output = Result<Self::Response, Self::Error>>;
    fn poll_ready(&self, ctx: &mut task::Context<'_>) -> Poll<Result<(), Self::Error>>;
    fn call(&self, req: Req) -> Self::Future;
}
